package org.im.service.websocket.test;

import javax.websocket.MessageHandler;
import javax.websocket.RemoteEndpoint;
import javax.websocket.RemoteEndpoint.Basic;

public class MyMessageHandler implements MessageHandler.Whole<String> {
	
	RemoteEndpoint.Basic remote = null;
	
	public MyMessageHandler(Basic remote) {
		super();
		this.remote = remote;
	}

	@Override
	public void onMessage(String msg) {
		try {
			remote.sendText(msg);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
